package com.whub507.msgmanager.sso.interceptor;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.Ordered;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class SessionInterceptorConfig implements WebMvcConfigurer {

	@Autowired
	private SessionInterceptor sessionInterceptor;

	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		// 配置会话拦截器，不拦截应用登录入口和应用注销入口
		registry.addInterceptor(sessionInterceptor)
				.addPathPatterns("/msg/**")
				.addPathPatterns("/project/**")
				.addPathPatterns("/Zwww/**")
				.order(Ordered.HIGHEST_PRECEDENCE);
	}

}
